package com.chinaums.fsp.sdk.request;

import com.chinaums.fsp.base.pgt.TransType;
import com.chinaums.fsp.sdk.base.RequestData;
import com.chinaums.fsp.sdk.base.ResponseDataWrapper;
import com.chinaums.fsp.sdk.pgt.params.DraftDealRequest;
import com.chinaums.fsp.sdk.pgt.params.DraftDealResponse;
import com.chinaums.fsp.sdk.pgt.params.PledgeCreateOrderRequest;
import com.chinaums.fsp.sdk.pgt.params.PledgeCreateOrderResponse; 
/**
 * 创建质押交易
 * @author hhh
 */
public class PledgeCreateOrderTest extends BaseRequest{

	public void testPledgeCreateOrderRequest() throws Exception {
		
		PgtRequestFactory rf = FACTORY.factory();
		
		RequestData.Builder builder = this.createRequestDataBuilder();
		builder.setTransType(TransType.TRANSPLEDGE_CREATE_ORDER.getTransCode());
		
		PledgeCreateOrderRequest data = PledgeCreateOrderRequest.newBuilder()
															.setPledgorWalletNo("801000000000013")
															.setPawneeWalletNo("801000000000014")
															// 票据信息：选填
//															.setDrawerName("深圳市天音通讯发展有限公司")
//															.setDrawerAccountNo("180201401400001784")
//															.setDrawerBank("民生123123123")
//															.setAcceptanceBankNo("301623")
//															.setAcceptanceBankAccountNo("123123123")
//															.setAcceptanceBankSimpleName("shenzhenfenhang")
//															.setTakerName("广东物资燃料有限公司")
//															.setTakerAccountNo("03010141700012347")
//															.setTakerBank("广州分行")
															// 票据信息：五要素
															.setInvoiceNo("90000000000507")
															.setInvoiceAmount(5L)
															.setIssueDate("20170101")
															.setExpireDate("20171201")
															.setAcceptanceBank("深圳分行")
															.build()
															;
		rf.transType(TransType.TRANSPLEDGE_CREATE_ORDER.getTransCode())
		.responseClass(PledgeCreateOrderResponse.class)
		.data(data)
		;
		ResponseDataWrapper rdw = rf.post();
	
		this.print(rdw);
	}
	
}